<?php

use App\Controllers\News;
use App\Controllers\Pages;

$routes->get('news', [News::class, 'index']);
$routes->get('news/new', [News::class, 'new']); 
$routes->post('news', [News::class, 'create']);
$routes->get('news/(:segment)', [News::class, 'show']);
$routes->get('pages', [Pages::class, 'index']);
$routes->get('(:segment)', [Pages::class, 'view']);
// 新闻列表页
$routes->get('news', 'News::index');
// 新闻创建页
$routes->get('news/new', 'News::new');
// 新闻保存（提交表单）
$routes->post('news/create', 'News::create');
// 新闻详情页
$routes->get('news/view/(:num)', 'News::view/$1');
// 新闻删除页（关键：添加此路由）
$routes->get('news/delete/(:num)', 'News::delete/$1');